UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z4pxjtMBNAxhJpmQwHQ8XhVVN/T4bE6LRv93PE+oc6w='
WHERE
key_id = 'eda0f1ebe1743b2c3ab29c922e63bdc644a87b78f8a53fadb882629c729341b5'
AND (
token = 'Z4pxjtMBNAxhJpmQwHQ8XhVVN/T4bE6LRv93PE+oc6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)