UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3utVH6vQhSfYT1/FopzxhXQSl9NPM8xmGUy4T/3zB40=' 
WHERE 
  key_id = '37cc83e84fc8773f5affa94f0fbb0763f479f47f966755af7a0c9977f337c424' 
  AND (
    token = '3utVH6vQhSfYT1/FopzxhXQSl9NPM8xmGUy4T/3zB40=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027