UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+6/sLTZy4Mrh8z4fXBV2NEYnOlX+KWr8BPC3hA82Sn0='
WHERE
key_id = '103e67deb3f18ade053ca8774cc0ffb040aee679aca102a5e6b566e722663e72'
AND (
token = '+6/sLTZy4Mrh8z4fXBV2NEYnOlX+KWr8BPC3hA82Sn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)