UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OLOqTjelxFw03c5EYwNH5BW6TB5wHQEf9CIkrFjBsOY=' 
WHERE 
  key_id = '59f8100441cd0020a114a53409124dba978dd0eb88b96ee8e1ba736e15be57ea' 
  AND (
    token = 'OLOqTjelxFw03c5EYwNH5BW6TB5wHQEf9CIkrFjBsOY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028