UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7lXnI3a1LiO7EnHtZaWMi+yjgk46g3b+XHdMZ1D0tm0='
WHERE
key_id = 'eeeb365fb9bcd8e93af5ceb2888a7f976452853caf84d2a32930b624f65c7a6f'
AND (
token = '7lXnI3a1LiO7EnHtZaWMi+yjgk46g3b+XHdMZ1D0tm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)