UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1s6xGBkZm1zDRQYcFaVMXKw3h9Os9YpjOPm3mLx65Sc=' 
WHERE 
  key_id = '37f705e1d342da739bbec63ea863788776d79436d8b900720d6ef0e1d617af1a' 
  AND (
    token = '1s6xGBkZm1zDRQYcFaVMXKw3h9Os9YpjOPm3mLx65Sc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033