UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7faGO4GKSj61b8LOGR1aY2K9v3FdMLMoXxN4Oj6ANoQ='
WHERE
key_id = 'bd1d925cf4defce605f17afb2f113c416b4a7f7f37fa396c099f5eb1724502ae'
AND (
token = '7faGO4GKSj61b8LOGR1aY2K9v3FdMLMoXxN4Oj6ANoQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)