UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JOh2cGOkM1EEXKwIAWZcU/5glEGzkglsfw6AELqoV70=' 
WHERE 
  key_id = '2a2a8525521a57506802a0580c9ba53ef12d623ab5f30d71ed5e095e598ec6fd' 
  AND (
    token = 'JOh2cGOkM1EEXKwIAWZcU/5glEGzkglsfw6AELqoV70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045