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