UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ewz+YBc+pLteah68q4fi76avY0LYiOmPKBxaR27s0eA='
WHERE
key_id = '1b9edcd18001736f3badd0734df05cd64a40774e98523edc743edffcacc65cbb'
AND (
token = 'Ewz+YBc+pLteah68q4fi76avY0LYiOmPKBxaR27s0eA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)