UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aq2/EfY457SQpfg0NSC+HrzmRSpxCIDmBayldmxELW0='
WHERE
key_id = '0e24409c17b9f3c29bfbfc8de19818634c7448c99549335b24ae34dd59ed2fbb'
AND (
token = 'aq2/EfY457SQpfg0NSC+HrzmRSpxCIDmBayldmxELW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)