UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sHNgxffyu1/g2goMZdnqJb2R5k6Ra1DY4HWarSGaY98=' 
WHERE 
  key_id = '37f628525c6fc0f932903e88f555a92629f2cdb271c6d2f01377ed3346cb5aad' 
  AND (
    token = 'sHNgxffyu1/g2goMZdnqJb2R5k6Ra1DY4HWarSGaY98=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029