UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jjWUN1/5u2ckEe/9t5utaThNb4peJVMGkvdeXTjfY5U='
WHERE
key_id = 'e7d13bac9c98a8edeb00b4b6e11e03fcd22fa42aa62d4ac4b19ab5d783bdd1c3'
AND (
token = 'jjWUN1/5u2ckEe/9t5utaThNb4peJVMGkvdeXTjfY5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)