UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+duwWW+V5lv7Elqgj7zXMiRtLAXpE1odrvkaJXYKrFg='
WHERE
key_id = '9dc0451c80889e0b242dda91d8c1c2d1c80435be9af1efaefc49ca8df26ea0c4'
AND (
token = '+duwWW+V5lv7Elqgj7zXMiRtLAXpE1odrvkaJXYKrFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)