UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PMK/1lCEj7w2zwEXVze5mXg8+5eWAIkOcjijR2BKY7o=' 
WHERE 
  key_id = '6cd655efd604f59f38838b6f42a1132307da5541a0fb1607af0be3a50cbc1e95' 
  AND (
    token = 'PMK/1lCEj7w2zwEXVze5mXg8+5eWAIkOcjijR2BKY7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054