UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T5PxcydWDeG3Sxta5KMRz/wn7j8OJQtW05lP/dVRy0k=' 
WHERE 
  key_id = 'acc44ec8817a21eaeca6af6db771ec4ffcd49475ddc1d6fe6b51c37410284dcd' 
  AND (
    token = 'T5PxcydWDeG3Sxta5KMRz/wn7j8OJQtW05lP/dVRy0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015