UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jc2aJiQL/x4GbLY3frM2/mZqbztcbxGxU18tqIESvws='
WHERE
key_id = '044b033297ba84e9fb2506c30f4317f5da817c985a0a9fb11c6ea8ce4714c22a'
AND (
token = 'jc2aJiQL/x4GbLY3frM2/mZqbztcbxGxU18tqIESvws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)