UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XRUMMeYORzE0vRA8b9rvsyzjQ5FPRxl46kCNI1ngd4o=' 
WHERE 
  key_id = 'e720e9e222ad440afb530df00ebc5fea01a63ba3c7215d74e910e7894c7527ad' 
  AND (
    token = 'XRUMMeYORzE0vRA8b9rvsyzjQ5FPRxl46kCNI1ngd4o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036