UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sGI/XVEqp6ScGXGRGr7CK1g56GRSCTWz85H9sCKwACg='
WHERE
key_id = '9de5d31dca9fbb5a24b67e73a1415a87ab40962a4d59ce974b4dee3e79c942b5'
AND (
token = 'sGI/XVEqp6ScGXGRGr7CK1g56GRSCTWz85H9sCKwACg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)