UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BZbKkX0T69KxtB5dEXg90gEir29nrjdEN0zfdff5oH4=' 
WHERE 
  key_id = '5ff2c7f563a1516d3a4e7bb74dc0cdd90751fb0fcfb1877e7a4d30fcd18c889b' 
  AND (
    token = 'BZbKkX0T69KxtB5dEXg90gEir29nrjdEN0zfdff5oH4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031