UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kh/iIgM0jYHvruCgWksYbrAsj6KvxRDAF2sGztzR06I='
WHERE
key_id = '2b6dc8cb5426764e3634f234c057f5046e4ef90a5a84bb3d38158e5543230c8d'
AND (
token = 'Kh/iIgM0jYHvruCgWksYbrAsj6KvxRDAF2sGztzR06I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)