UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H1k9HAJwhlhyURq+amlMt5DA1w/sDvOthYyyIvNgxQ8='
WHERE
key_id = '6284a7e8dd4ba2387076c851957f7b12056efb77eff3181bc829edf42e97e49f'
AND (
token = 'H1k9HAJwhlhyURq+amlMt5DA1w/sDvOthYyyIvNgxQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)