UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZGyKuOIzYoemzMZbLTTf1lQv3B5WndP6pnkVgCNwEEg='
WHERE
key_id = '0ab3386a11c5fee83711f72e1ec944ce513a509bbf1704e4ca3739c8ea26c883'
AND (
token = 'ZGyKuOIzYoemzMZbLTTf1lQv3B5WndP6pnkVgCNwEEg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)