UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tbJVObccEYKX6hGcA/GjFu9inaSjKvf7oY4OchNuMhQ=' 
WHERE 
  key_id = '7f2cbda06d742eaf67a96d003bcaeed0e106fe1cfcfcef84a7cc20cfadc4ae48' 
  AND (
    token = 'tbJVObccEYKX6hGcA/GjFu9inaSjKvf7oY4OchNuMhQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031