UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IkUmBYrRBZso/VBmlsukBkfXQcP0vzvhWo9KiJeWHDc='
WHERE
key_id = 'f3202df586ead473c5b2bef04257472e9176417b616fdcc3ec682083bae66638'
AND (
token = 'IkUmBYrRBZso/VBmlsukBkfXQcP0vzvhWo9KiJeWHDc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)