UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Js8RVmcsm6SmJBdB6UilyrsJm8BiPY0Ls0LyiFBgpY4='
WHERE
key_id = '825904b13758d3e923aa8ae34cc34bebb715399d3fe8ec877914c62b66ac2690'
AND (
token = 'Js8RVmcsm6SmJBdB6UilyrsJm8BiPY0Ls0LyiFBgpY4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)