UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E+H6lq9Bztu7/UFiD1uTtFjnLhnjhIvNLvp/t8VJE2k=' 
WHERE 
  key_id = 'e3e3a0ce3b4c75e3ed3351de1c70e0fe08112518a96a5778e3e9a4d7bbba5053' 
  AND (
    token = 'E+H6lq9Bztu7/UFiD1uTtFjnLhnjhIvNLvp/t8VJE2k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056