UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xk1AAi1s54eAjhJIgJvKvjcQz/ZS2fRECWLWDom31JU='
WHERE
key_id = '5e157f4d1b88088c3f4e9ed014cbe911c5cee0e8655c5c8c600d1c258baea38c'
AND (
token = 'xk1AAi1s54eAjhJIgJvKvjcQz/ZS2fRECWLWDom31JU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)