UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iX6HhPZQvTa8zcNtusXDMpRraEyVU43cZ+FoI1It+mU='
WHERE
key_id = '06ae28a456b18fd264d250de648fb64fba18ce28fca3172e043c5bfdd63d6fb9'
AND (
token = 'iX6HhPZQvTa8zcNtusXDMpRraEyVU43cZ+FoI1It+mU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)