UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dh2bAkF1qMhTkDjeWpF/IgeQr8AxlY8hCo7/sU0CDVI='
WHERE
key_id = '0a65c4c0411b7116cfea2181692d0e1ab83dd2183792c40955b2b11dac6c9ab8'
AND (
token = 'dh2bAkF1qMhTkDjeWpF/IgeQr8AxlY8hCo7/sU0CDVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)