UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'by6lLaF+uGC30UMaxEXV4gRO1iJq86bk9QL5DFojoe4='
WHERE
key_id = '67b11c06ea706cf503016adb0d15cf263585a91d88be7f5a11dae95c87312334'
AND (
token = 'by6lLaF+uGC30UMaxEXV4gRO1iJq86bk9QL5DFojoe4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)