UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A4/TOuorHjB+xYMSwOeAPckS0wSICiE7WmD3OEmutrE='
WHERE
key_id = '7238be00ab4009cec2eef2e8b4cd14182d00f3e242b644d462ea06bbd9f1d8c2'
AND (
token = 'A4/TOuorHjB+xYMSwOeAPckS0wSICiE7WmD3OEmutrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)