UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3i2mpXSvf7YzofT8an8W2wReRp6x4SSs4D7WgwTyysE='
WHERE
key_id = 'aa35e9beb888fe507bfe3bf4b336add9cc6f56c001d3c1d45f5f1e9008859360'
AND (
token = '3i2mpXSvf7YzofT8an8W2wReRp6x4SSs4D7WgwTyysE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)