UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AHNzssIfzKBtfwKjdCH6Kr96indU2q5Jyx+xsBzYR8Y='
WHERE
key_id = 'f0930e52bdecec5d81e0485dee8129ab023bf156c57983628a2ee0ebeee9d3b1'
AND (
token = 'AHNzssIfzKBtfwKjdCH6Kr96indU2q5Jyx+xsBzYR8Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)