UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iLs95MNBMXb5aT8yl8/q+9Uf/AicDQB70igVfyMGZNw=' 
WHERE 
  key_id = 'a39fa2c1f9bad810d2cca98214665b24b0498de535ba0d38fc600b0a9f70053b' 
  AND (
    token = 'iLs95MNBMXb5aT8yl8/q+9Uf/AicDQB70igVfyMGZNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028