UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BztZYsGCEvrd+yN1NgtrKlqTtjt6WCZk7HXNh7JFpBs='
WHERE
key_id = '5af8641f8357868ce57e037559b4473c0492e13a9a5401813db869a4709400ba'
AND (
token = 'BztZYsGCEvrd+yN1NgtrKlqTtjt6WCZk7HXNh7JFpBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)