UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '26R1UuAVCJ22Lyg2AelwSucH+aPfpWcu8TtdIakSwVk=' 
WHERE 
  key_id = 'b289a6c421b28db3cc2c83bf00e0e1bdba9c52cd138306e38aee80550dd8193d' 
  AND (
    token = '26R1UuAVCJ22Lyg2AelwSucH+aPfpWcu8TtdIakSwVk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029