UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's3us6vV7R4F/l1WnP16FFaVgXh8YzdwoyQ28baz1HQ0='
WHERE
key_id = '7662d91d0ebdafedcfc62fc84378d9353492841da06477fb3849e7750dcf87c0'
AND (
token = 's3us6vV7R4F/l1WnP16FFaVgXh8YzdwoyQ28baz1HQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)