UPDATE 
  cscart_aprillock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '40c4p8AN81ahNspO3YbndPbQwhcL/4V8ybwA6/L/mCU=' 
WHERE 
  key_id = 'e6d3daa2e2db3461988062f07bbb6f647c7bc63798a0d663343099e46b6936d7' 
  AND (
    token = '40c4p8AN81ahNspO3YbndPbQwhcL/4V8ybwA6/L/mCU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037