UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'henvP0OAltkbRC2x0rVzjPulgs0/fXfE9ylLxjUyWlc='
WHERE
key_id = '21413a8c700f5c5c245e06ebc7712ec36be7c7014811c61cc21051a481626017'
AND (
token = 'henvP0OAltkbRC2x0rVzjPulgs0/fXfE9ylLxjUyWlc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)