UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UEPuiAbVV+AQdYYv9z5qyD7bOIqzTN6XQR45XKG4RIw=' 
WHERE 
  key_id = '307d63ad6cff0fffe0be81534477117b972d60d4eb65320b2346af3ab92066a1' 
  AND (
    token = 'UEPuiAbVV+AQdYYv9z5qyD7bOIqzTN6XQR45XKG4RIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00081