UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mFwLOK2uFcAUXqoOHTJMsEV2Ox6EJl/XYEOIU0VRIs4=' 
WHERE 
  key_id = '63e9437209ad96881b87aa7a05243846035fdfc4625c720b1d67f092b7be8016' 
  AND (
    token = 'mFwLOK2uFcAUXqoOHTJMsEV2Ox6EJl/XYEOIU0VRIs4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032