UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KIl5/mPFldPW4uLxzzGAVeAEJL4nHqSU6HF9Sa8SCg8='
WHERE
key_id = '03dd9cccaf52dbd9c55cebc795a954f434491df6acd6e385b71fef3de6158c19'
AND (
token = 'KIl5/mPFldPW4uLxzzGAVeAEJL4nHqSU6HF9Sa8SCg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)