UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9LRVSVKQilMmgHNmnGS/KMgQlBY92j44yjqzGekJBK4='
WHERE
key_id = 'bf6b2fdb1760d704b9e1ca8aecabef6cdd640aecf9dc7fbbe66860f4eebea091'
AND (
token = '9LRVSVKQilMmgHNmnGS/KMgQlBY92j44yjqzGekJBK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)