UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PXWrMjo22j+hFxUuY9b1BoLco0y8qytwoO40M4nwtp0='
WHERE
key_id = '0eacac83c9a3d04ca40e8159922dca2846e31a41d07e311b918abd51c258282e'
AND (
token = 'PXWrMjo22j+hFxUuY9b1BoLco0y8qytwoO40M4nwtp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)