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