UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Q/QL1K2lmW2+x2p+7Wt3JNDJE6QEeQVX482nZlXTaA='
WHERE
key_id = 'd294c41906c6cb970fa21ae0d7f091cdedea4c391ffb3d0930fb9e691886c1da'
AND (
token = '7Q/QL1K2lmW2+x2p+7Wt3JNDJE6QEeQVX482nZlXTaA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)