UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QbpTN2mFd4JMA1VpvgvU7PvpeGJ/CuKEMNGE00tlmnI='
WHERE
key_id = '1e723d92638b60ba231a5a70a6bdc6252a69666a1fa13fef8279dd39f73252d3'
AND (
token = 'QbpTN2mFd4JMA1VpvgvU7PvpeGJ/CuKEMNGE00tlmnI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)