UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uygWZSA464HtVVzLEBr2nBXGHf8W4I2uaslFQY1fNVU=' 
WHERE 
  key_id = '2c61a067c46aa541485b1fbf2c696e15c97f1c076bd6f2c7edaeb1e3a9144625' 
  AND (
    token = 'uygWZSA464HtVVzLEBr2nBXGHf8W4I2uaslFQY1fNVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048