UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'viJUziZHC1qXquDZM7UzuRTw8LbNNWYNE6waM/U6oRo=' 
WHERE 
  key_id = 'ebd4d97280ebbf85198538a6f2633e2273dc4d5dee6a06c99fad93cab8e8f4c9' 
  AND (
    token = 'viJUziZHC1qXquDZM7UzuRTw8LbNNWYNE6waM/U6oRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043