UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dqxDVMV5RKzX1r92rr8BoF8BnAjWlg/vMD1sBxZOIL4=' 
WHERE 
  key_id = 'f88620248802f667a4cdbba3909c4f10e689e9fbd5b6614951364ed68835fc72' 
  AND (
    token = 'dqxDVMV5RKzX1r92rr8BoF8BnAjWlg/vMD1sBxZOIL4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031