UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UKYVnCX5rthvOZf7UL/6RGZWNKzmkLdZUdGJFmChNlg='
WHERE
key_id = '21e93b09501dffc405b4235765777e596cf59e171310bcdcf357ee6800abab33'
AND (
token = 'UKYVnCX5rthvOZf7UL/6RGZWNKzmkLdZUdGJFmChNlg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)