UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HK+uAmanAZJs5lAXrtkrsfWZ3zSsqwmA6g8i182Vq/I='
WHERE
key_id = '3775fcbcf5e20b92430b9b0a867de10aaf2c69fef6d8b7fdcb551c32ee352e3c'
AND (
token = 'HK+uAmanAZJs5lAXrtkrsfWZ3zSsqwmA6g8i182Vq/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)