UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qJWC4R587BXAphcxZ1PDojKK+vzClnILNLUgPSwvUZM=' 
WHERE 
  key_id = '53fe71f0331717d4fff5a8dacca00cc0b7ace1043176a262b9324b1a0cde6d03' 
  AND (
    token = 'qJWC4R587BXAphcxZ1PDojKK+vzClnILNLUgPSwvUZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044