UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aKdFxPmV3gElgNci5PLG4q0Dll2yQEtTXUMAFwDhkb4=' 
WHERE 
  key_id = '1fb4aaace8692c68ab89e6bb387668f7987f56ff7b8cc5a8bf19a2ea88fff677' 
  AND (
    token = 'aKdFxPmV3gElgNci5PLG4q0Dll2yQEtTXUMAFwDhkb4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035