UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nkNKyJmVUGpNmbLLTeEEr/a7hHPmjx/aTd9aQauZb7U=' 
WHERE 
  key_id = '42b29a8d41e5302ca870bc6d1e6b5bdcd30e034e4db63d5ee654c281c63f6fab' 
  AND (
    token = 'nkNKyJmVUGpNmbLLTeEEr/a7hHPmjx/aTd9aQauZb7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019