UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4nz4fhxoJYurV7FVu+rBiFBgIbHea0pqJrhlE4d65Sk=' 
WHERE 
  key_id = 'e2db0dc210d4967bebe20731f2bd91445a2c457e28bd3b47ad93708fd2b1e40b' 
  AND (
    token = '4nz4fhxoJYurV7FVu+rBiFBgIbHea0pqJrhlE4d65Sk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042