UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rnCL5Z92h++JWr8l/pBAe9HMZm/Ns0MW/bFLI4iu6hA=' 
WHERE 
  key_id = '9b80ca8883287c70ba385395b770e34e5f5d8316c69de08e84813fc33184f779' 
  AND (
    token = 'rnCL5Z92h++JWr8l/pBAe9HMZm/Ns0MW/bFLI4iu6hA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063