UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yci2ALQ0Nnz2c5oOW2VSCIKnMEtd5LcljbFX3kuetCo='
WHERE
key_id = 'd44449c7c6e633b3ef5660ebfc2043beb2c5e5f94fce8eaca617b6894593fa1e'
AND (
token = 'Yci2ALQ0Nnz2c5oOW2VSCIKnMEtd5LcljbFX3kuetCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)