UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E6Y8HME96yJE5cHtGAgqR4fFFMHAUAYuzTZm965LpVs='
WHERE
key_id = '752b5986600b76012eb4b6c540620545c989371fe205688d027a7b9d0809a77c'
AND (
token = 'E6Y8HME96yJE5cHtGAgqR4fFFMHAUAYuzTZm965LpVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)