UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k4qRS18LAhswW14KU332NLDCyhI0Xqyb/9acMR+2HNM='
WHERE
key_id = '1005ed9f773959770b77969adc8d3311e8c7892f12eeba603642ae24e8031a4c'
AND (
token = 'k4qRS18LAhswW14KU332NLDCyhI0Xqyb/9acMR+2HNM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)