UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K0mlFTbXz5uyhkZXyZBZr2Vmceh2XW0Aqso6mslh6cM='
WHERE
key_id = '98d72f48bf2428955896c5fec11723bd63442adc447dc0e94cad233fcacdfb46'
AND (
token = 'K0mlFTbXz5uyhkZXyZBZr2Vmceh2XW0Aqso6mslh6cM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)