UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rsZuaDq/9Ltv3rJcMgD4zGkMMbf6iCBG4SQ4Q+IiQvo='
WHERE
key_id = 'e34ea4545a257c74e779b560d021628cc4263a5b4c59b140a6012a9b4390deaf'
AND (
token = 'rsZuaDq/9Ltv3rJcMgD4zGkMMbf6iCBG4SQ4Q+IiQvo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)