UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A2usXaVlFG+QzaKK+LcSMgk3AGEIQiZvwOl8a2piBtQ='
WHERE
key_id = '4695538c46febc1652d909307c42dff0305ecdca3ffce13d75ab4f20f4ce37c9'
AND (
token = 'A2usXaVlFG+QzaKK+LcSMgk3AGEIQiZvwOl8a2piBtQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)